//
//  YBNewsCell.m
//  解析HTML
//
//  Created by 尚往文化 on 17/9/13.
//  Copyright © 2017年 YBing. All rights reserved.
//

#import "YBNewsCell.h"
#import <UIImageView+WebCache.h>

@implementation YBNewsCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setNews:(YBNews *)news
{
    _news = news;
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:news.img]];
    
    self.titleLabel.text = news.title;
    self.descLabel.text = news.desc;
    if (![news.source isEqualToString:@"来源："]) {
        self.tagLabel.text = news.source;
    }
    self.likenumLabel.text = news.time;
}

- (void)setRecommend_news:(YBNews *)recommend_news
{
    _news = recommend_news;
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:recommend_news.img]];
    
    self.titleLabel.text = recommend_news.title;
    self.descLabel.text = recommend_news.desc;
    self.likenumLabel.text = recommend_news.time;
    
}

@end
